package cn.maihe.elg.operation.web.system;

import cn.maihe.elg.operation.repository.entity.OperateLogDO;
import cn.maihe.elg.operation.service.system.impl.OperateLogServiceImpl;
import cn.maihe.framework.starter.base.sql.PageBo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description
 * @Author WJH
 * @Date 2021/03/22
 */
@Api(value = "操作日志", tags = {"操作日志"})
@RestController
@RequestMapping("/api")
public class OperateLogController {

    @Resource
    private OperateLogServiceImpl operateLogService;

    @ApiOperation(value = "查询操作日志列表", notes = "根据机构代码查询操作日志列表")
    @RequestMapping(value = "/operateLogs", method = RequestMethod.GET)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNo", value = "页数", dataType = "int", paramType = "query", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页大小", dataType = "int", paramType = "query", required = true),
            @ApiImplicitParam(name = "userCreate", value = "操作账户(模糊查询)", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "beginCreateTime", value = "开始时间 yyyy-mm-dd HH:mm:ss", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endCreateTime", value = "结束时间 yyyy-mm-dd HH:mm:ss", dataType = "String", paramType = "query")
    })
    public PageBo<OperateLogDO> selectPageList(int pageNo, int pageSize, String userCreate, String beginCreateTime, String endCreateTime) {

        return operateLogService.selectPageList(pageNo, pageSize, userCreate, beginCreateTime, endCreateTime);
    }

}
